package cn.java86.test;

import cn.java86.dao.ExamDao;
import cn.java86.entity.Exam;
import cn.java86.util.MybatisUtil;
import org.apache.ibatis.session.SqlSession;

/**
 * @author oldliu
 * @since 1.0
 */
public class QueryEXamAndStudent {
    public static void main(String[] args) {
        ///找考试记录同时找到考生全部信息
        SqlSession s= MybatisUtil.get();
        ExamDao mapper = s.getMapper(ExamDao.class);
        Exam exam = mapper.get(5L);
        System.out.println("考试成绩如下：");
        System.out.println(exam);
        System.out.println("考生信息如下：");
        System.out.println(exam.getStu());
        MybatisUtil.close(s);
    }
}
